{% extends 'myadmin/base/content_base.html' %}
{% load static %}
{#{% load news_template_filters %}#}
{% block page_header %}
    系统设置
{% endblock %}
{% block page_option %}
    权限分组
{% endblock %}
{% block content %}
    <div class="box">
        <div class="box-header with-border">
            <h3 class="box-title">分组列表</h3>
            <div class="box-tools">
                <button type="button" class="btn btn-primary btn-sm"
                        data-url="{% url 'myadmin:group_add' %}">添加分组
                </button>
            </div>
        </div>
        <!-- /.box-header -->

        <div class="box-body">
            <div style="margin-bottom: 10px">

            </div>

            <table class="table table-bordered">
                <tbody>
                <tr>
                    <th>#</th>
                    <th>组名</th>
                    <th>菜单</th>
                    <th>操作</th>
                </tr>
                {% for group in groups %}
                    <tr>
                        <td style="width: 40px" data-url="{% url 'myadmin:group_update' group.id %}"><a
                                href="#">{{ forloop.counter }}</a></td>
                        <td>{{ group.name }}</td>
                        <td>
                            {% for permis in group.permissions.all %}
                                {{ permis.name }}/
                            {% empty %}
                                暂未分配权限
                            {% endfor %}
                        </td>
                    <td>
                        <button class="btn btn-xs btn-danger btn-del" data-name="{{ group.name }}" data-id="{{ group.id }}">删除</button>
                    </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
             <div class="modal modal-danger fade" id="modal-delete">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">警告</h4>
                </div>
                <div class="modal-body">
                    <p>One fine body&hellip;</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-outline pull-left" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-outline delete-confirm">确定</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
{% endblock %}
{% block script %}
    <script src="{% static 'js/myadmin/group/group_list.js' %}"></script>
        <script src="{% static 'js/myadmin/group/group_delete.js' %}"></script>
{% endblock %}